home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr44
/
speller2.zip
/
XMM.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-06
|
1KB
|
60 lines
#if !defined(_XMSARRAY_H)
#define _XMSARRAY_H
#define BYTE unsigned char
#define WORD unsigned int
#define BAD_PAGE 0xFFFF /* set to invalid page ID */
#define PageSize 4096
class LRU
{
public:
LRU(int pages = 4 );
~LRU();
int search(WORD page_id, WORD *buffer);
void update(WORD node);
void fifo_reset();
protected:
int n_pages; // pages in cache
int list_head;
struct fifo_queue
{
WORD succ; /* index of next younger node */
WORD pred; /* index of next older node */
BYTE dirty_bit; /* TRUE if page has been written to */
WORD page_id; /* ID of page associated w/this node */
WORD page_off;
};
fifo_queue *lru_fifo;
};
class xms :public LRU
{
public:
char far *buffer;
unsigned int handle; /* EMB handle allocated */
long curblock;
unsigned int CacheSize;
long size;
unsigned mask;
unsigned int error; /* error code returned be most routines */
long page;
unsigned int offset;
xms(long size,unsigned int &,int pages = 4 );
~xms();
void *at(const long index);
void *ats(const long index);
int valid() { return state;}
protected:
int state;
unsigned int XMSsize;
};
#endif